package com.contact.util.util.filters;


public class WildCardDataFilter extends AbstractDataFilter<String, String> {

    private static final long serialVersionUID = 4059546915626163370L;

    private SearchType searchType = null;


    public WildCardDataFilter(String key) {
        this(key, SearchType.CONTAINS);
    }

    public WildCardDataFilter(String key, SearchType searchType) {
        super(DataFilterType.WILD_CARD, key);
        setSearchType(searchType);
    }

    @Override
    public final void setFilterValue(String filterValue) {
        //do nothing

    }


    @Override
    public final void setDisplayValue(String displayValue) {
        super.setDisplayValue(displayValue);

        super.setFilterValue(searchType.getWildCardValue(displayValue));

    }


    public final void setSearchType(SearchType searchType) {
        this.searchType = searchType;
    }

    public final SearchType getSearchType() {
        return this.searchType;
    }

}
